package com.huibur.controller;


import com.huibur.entity.User;
import com.huibur.mapper.UserMapper;
import com.huibur.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yanzichu
 * @since 2021-11-19
 */
@RestController
@RequestMapping("/user")
@Api(value = "用户管理",tags = {"用户管理"})
@Slf4j
public class UserController {

    @Autowired
    IUserService iUserService;
    @Autowired
    UserMapper userMapper;
    /**
     * 新增用户
     *
     * @param user
     * @return
     */
    @PostMapping("/xin")
    @ApiOperation(value = "新增用户")
    public int insert(@RequestBody User user){

            return userMapper.insert(user);


    }
}
